package com.sharepics.servlets;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;

public class GetUploadURLPictureServlet extends HttpServlet{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1941284476642692079L;
	
	private static final Logger log =
        Logger.getLogger(GetUploadURLPictureServlet.class.getName());
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws IOException {
		
		log.info("GET Upload-----------------");
		BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
		String uploadUrl = blobstoreService.createUploadUrl("/srv/picture/upload");
		resp.addHeader("uploadUrl", uploadUrl);
	}
}
